import { RematchRootState, RematchDispatch } from "@rematch/core";
import { ExtraModelsFromLoading } from "@rematch/loading";
import { RouteComponentProps } from "react-router-dom";
import * as models from "./models";
/**
 * @rematch/loading 插件的模块的类型声明
 */
export type ExtraModelsLoading = ExtraModelsFromLoading<typeof models>;

/**
 * redux的store的satte属性声明
 */
export type RootState = RematchRootState<typeof models, ExtraModelsLoading>;

/**
 * redux的store的dispatch属性声明
 */
export type RootDispatch = RematchDispatch<typeof models>;

/**
 * 路由参数 Props 类型声明
 */
export type RouterProps = RouteComponentProps<any>;

/**
 * 映射状态（从 store 中获取某些状态并传递给当前组件）类型声明
 */
export type MapStateFromStoreProps<T extends (...args: any) => any> = ReturnType<T>;

/**
 * 组件派发 action 集合的类型声明
 */
export type MapDispatchFromStoreProps<S extends (...args: any) => any> = ReturnType<S>;
